<!--# layout("/common/layout.html",{"jsBase":"/js/activity/activityComment/"}){ -->

<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">
    <input type="hidden" name="commentId" id="commentId">

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">活动名称</label>
				<div class="layui-input-inline">
                                <input type="text" name="actName" id="actName" autocomplete="off" maxlength="50" class="layui-input" disabled>
				</div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">会员</label>
                <div class="layui-input-inline">
                    <input type="text" name="customerName" id="customerName" autocomplete="off" maxlength="50" class="layui-input" disabled>
                </div>
            </div>


        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">

            <div class="layui-inline">
            <label class="layui-form-label">留言时间</label>
				<div class="layui-input-inline">
                       <input type="text" name="commentTime" id="commentTime" autocomplete="off" maxlength="50" class="layui-input" disabled>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">留言日期</label>
				<div class="layui-input-inline">
                                <input type="text" name="commentDay" id="commentDay" autocomplete="off" maxlength="50" class="layui-input" disabled >
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">活动类型</label>
                <div class="layui-input-inline">
                    <select class="select" name="actType" id="actType"  promtion="请选择" lay-verify="require" disabled>
                        <option value="">请选择</option>
                        <option value="1">助力高考</option>
                    </select>
                </div>
            </div>

            <div class="layui-inline">
            <label class="layui-form-label">显示状态</label>
                <div class="layui-input-inline">
                    <select class="select" name="displayFlag" id="displayFlag"  promtion="请选择" lay-verify="required">
                        <option value="">请选择</option>
                        <option value="1">显示</option>
                        <option value="0">屏蔽</option>
                    </select>
                </div>
            </div>

        </div><!--form item-->
    </div><!--row-->
<div class="layui-row">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">处理意见</label>
            <div class="layui-input-block" style="width:512px">
                <textarea name="handleMemo"  id="handleMemo" placeholder="请输入" class="layui-textarea" ></textarea>
            </div>
        </div>
    </div>
</div>
<div class="layui-row">
    <div class="layui-form-item">
				</div>
            </div>
        </div>
    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
layui.extend({
    loading: '../../../plugins/layui_extends/loading/loading',
}).define([ 'form', 'laydate', 'table','loading','activityCommentApi'], function(exports) {
    var form = layui.form;
    var activityCommentApi = layui.activityCommentApi;
    var index = layui.index;
    var isNew = true;
    <!--# if(!(isEmpty(activityCommentJson))){  -->
    isNew = false;
    <!--# } -->
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                // $("#addButton").hide();
                // $("#addButton-loading").show();
                // $("#addButton-loading").loading();
                var displayFlag = $("#displayFlag").val();
                var handleMemo = $("#handleMemo").val();
                if(displayFlag==""){
                    Common.info("请选择显示状态");
                    return;
                }

                if(displayFlag=="0"&&handleMemo==""){
                    Common.info("处理意见不能为空");
                    return;
                }
                form.on('submit(form)', function(){
                    activityCommentApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }
    view.init();
    <!--# if(!(isEmpty(activityCommentJson))){  -->
    var formJson = ${activityCommentJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
